home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / pov / povlisti.ngs / petals.pov < prev    next >
Encoding:
Text File  |  1992-09-13  |  8.3 KB  |  329 lines

  1. // Persistence of Vision Raytracer
  2. // Petals, An as yet undiscovered flowering plant
  3. // By Douglas Otwell
  4.  
  5. //----------------------------------------------------------------------------
  6. // INSTRUCTIONS:  This data file is designed to be rendered in two passes,
  7. //   with a post-processing step in between.  This accomplishes the depth-
  8. //   of-field effect.  An image processor such as Piclab is needed to smooth
  9. //   the first rendering, which is then used as a backdrop for render #2.
  10. // Step 1.)  Render this file as is.  This will render just the two
  11. //           background plants and sky.
  12. // Step 2.)  Take the result and smooth it with an image processor. I used
  13. //           twelve SMOOTH commands in Piclab. Save the result as 
  14. //           PETALSBG.TGA
  15. // Step 3.)  Comment out the "Background scene" section at the end of this
  16. //           file.  Remove the comments around "Final Scene".  Render.
  17. //----------------------------------------------------------------------------
  18.  
  19.  
  20. #include "colors.inc"
  21. #include "shapes.inc"
  22. #include "textures.inc"
  23.  
  24. camera {
  25.    location  <0.0  90.0  -120.0>
  26.    direction <0.0 0.0  2.0>
  27.    up        <0.0  1.0  0.0>
  28.    right     <1.33333 0.0 0.0>
  29.    look_at   <0.0 65.0 0.0>
  30. }
  31.  
  32. object {  
  33.    light_source {<20 120 -50> color White}
  34. }
  35. object {  
  36.    light_source {<-20 120 -50> color White}
  37. }
  38.  
  39.  
  40. #declare leaf_texture = texture {
  41.    leopard
  42.    turbulence 1.0
  43.    color_map {
  44.       [0.0 0.1   color ForestGreen  color MediumForestGreen]
  45.       [0.1 0.4   color MediumForestGreen  color White]
  46.       [0.4 0.6   color White color GreenYellow]
  47.       [0.6 1.001 color GreenYellow color GreenYellow]
  48.    }
  49.    scale <0.1 0.1 0.1>
  50.    phong 1.0 phong_size 70.0
  51. }
  52. #declare stem_texture = texture {
  53.    bozo
  54.    turbulence 1.0
  55.    color_map {
  56.       [0.0 0.6   color MediumSeaGreen color MediumSeaGreen]
  57.       [0.6 1.001 color MediumSeaGreen color YellowGreen]
  58.    }
  59.    phong 0.8 phong_size 70.0
  60.    scale <0.5 0.5 0.5>
  61. }
  62. #declare sepal_texture = texture {
  63.    color MediumSeaGreen 
  64.    phong 0.8 phong_size 10.0
  65.    bumps 1.0
  66.    scale <0.5 12 0.5>
  67. }
  68. #declare petal_texture = texture {
  69.    gradient <0 1 0>
  70.    color_map {
  71.       [0.0 0.8 color White color Violet]
  72.       [0.8 1.001 color Violet color Violet]
  73.    }
  74.    scale <1 18 1>
  75.    translate <0 -6 0>
  76.    bumps 1.0
  77.    scale <0.5 0.5 0.5>
  78.  
  79.    ambient 0.3
  80.    diffuse 0.6
  81. }
  82.  
  83. /* Texture declarations for object 'leaf1_side1' */
  84. #declare leaf_side2_C1 = texture {leaf_texture}
  85. #declare leaf_side4_C1 = texture {leaf_texture}
  86. #declare leaf_side1_C1 = texture {color MediumSeaGreen}
  87. #declare leaf_side6_C1 = texture {color MediumSeaGreen}
  88.  
  89. #declare leaf = composite {  /* All Objects */
  90.     #include "leaf2.inc"
  91.  
  92.     bounded_by {
  93.         box { <-1.8000 0.0000 -1.0000> <1.8000 12.0000 3.2154> }
  94.     }
  95.  
  96.     /*
  97.         Scene extents
  98.         X - Min:  -1.8000  Max:   1.8000
  99.         Y - Min:   0.0000  Max:  12.0000
  100.         Z - Min:  -1.0000  Max:   3.2154
  101.     */
  102. }
  103.  
  104. #declare leaves = composite {
  105.    composite {
  106.       leaf
  107.       scale <1 1.4 1>
  108.       rotate <0 10 0>
  109.       translate <0 0 3>
  110.       rotate <0 -55 0>
  111.    }
  112.    composite {
  113.       leaf
  114.       rotate <0 10 0>
  115.       translate <0 0 3>
  116.       rotate <0 -10 0>
  117.    }
  118.    composite {
  119.       leaf
  120.       scale <1 1.2 1>
  121.       rotate <0 10 0>
  122.       translate <0 0 3>
  123.       rotate <0 45 0>
  124.    }
  125.    composite {
  126.       leaf
  127.       rotate <0 10 0>
  128.       translate <0 0 3>
  129.       rotate <0 115 0>
  130.    }
  131.    composite {
  132.       leaf
  133.       scale <1 1.2 1>
  134.       rotate <0 10 0>
  135.       translate <0 0 3>
  136.       rotate <0 265 0>
  137.    }
  138. }
  139.  
  140. #declare blossom1 = composite {
  141.    object {
  142.       union {
  143.          quadric {Ellipsoid scale <3 6 1.2>}
  144.          quadric {Ellipsoid scale <3 6 1.0> rotate <0 60 0>}
  145.          quadric {Ellipsoid scale <3 6 1.4> rotate <0 120 0>}
  146.       }
  147.       clipped_by {
  148.             quadric {Ellipsoid inverse scale <3 3 3> translate <0 -4 0>}
  149.       }
  150.       texture {petal_texture}
  151.       bounded_by {sphere {<0 0 0> 6}}
  152.    }
  153.    object {
  154.       quadric {Ellipsoid scale <1.6 3 1.5>}
  155.       texture {sepal_texture}
  156.       translate <0 5 0>
  157.    }
  158. }
  159.  
  160. #declare blossom2 = composite {
  161.    object {
  162.       union {
  163.          quadric {Ellipsoid scale <4 6 1.4>}
  164.          quadric {Ellipsoid scale <4 6 1.6> rotate <0 60 0>}
  165.          quadric {Ellipsoid scale <4 6 1.8> rotate <0 120 0>}
  166.       }
  167.       clipped_by {
  168.             quadric {Ellipsoid inverse scale <6 6 6> translate <0 -5 0>}
  169.       }
  170.       texture {petal_texture}
  171.       bounded_by {sphere {<0 0 0> 6}}
  172.    }
  173.    object {
  174.       quadric {Ellipsoid scale <1.5 3 1.6>}
  175.       texture {sepal_texture}
  176.       translate <0 5 0>
  177.    }
  178. }
  179.  
  180. #declare stem = object {
  181.    intersection {
  182.       quartic {
  183.          < 1  0  0  0  2
  184.            0  0  2  0 -50.32
  185.            0  0  0  0  0
  186.            0  0  0  0  0
  187.            1  0  0  2  0
  188.            49.68 0  0  0  0
  189.            1  0 -50.32 0 617.0256>
  190.       }
  191.       plane {<0 0 1> 0 inverse}
  192.       plane {<0 0 1> 0 inverse rotate <0 45 0>}
  193.    }
  194.    bounded_by {box {<-5.4 -0.4 -5.4> <5.4 0.4 5.4>}}
  195.  
  196.    texture {stem_texture}
  197.    rotate <-90 0 0>
  198. }
  199.  
  200. #declare branch1 = composite {
  201.    composite {
  202.       blossom1
  203.       translate <-5 -8 0>
  204.       rotate <0 0 -45>
  205.    }
  206.    object {stem}
  207.    translate <-5 0 0>
  208. }
  209. #declare branch2 = composite {
  210.    composite {
  211.       blossom2
  212.       translate <-5 -8 0>
  213.       rotate <0 0 -45>
  214.    }
  215.    object {stem}
  216.    translate <-5 0 0>
  217. }
  218.  
  219. #declare tier1 = composite {
  220.    composite {branch1}
  221.    composite {branch1 rotate <0 72 0>}
  222.    composite {branch2 rotate <0 144 0>}
  223.    composite {branch1 rotate <0 216 0>}
  224.    composite {branch2 rotate <0 288 0>}
  225. }
  226.  
  227. #declare tier2 = composite {
  228.    composite {branch2}
  229.    composite {branch1 rotate <0 72 0>}
  230.    composite {branch2 rotate <0 144 0>}
  231.    composite {branch1 rotate <0 216 0>}
  232.    composite {branch2 rotate <0 288 0>}
  233. }
  234.  
  235.  
  236. // Plant
  237. #declare plant = composite {
  238.    composite {
  239.       composite {tier2 translate <0 40 0>}
  240.       composite {tier2 rotate <0 40 0> translate <0 48 0>}
  241.       composite {tier2 rotate <0 70 0> translate <0 56 0>}
  242.       composite {tier1 rotate <0 20 0> translate <0 64 0>}
  243.       composite {tier1 rotate <0 50 0> translate <0 72 0>}
  244.       composite {branch1 rotate <0 20 0> translate <0 78 0>}
  245.       composite {branch1 rotate <0 150 0> translate <0 81 0>}
  246.       composite {branch1 rotate <0 240 0> translate <0 83 0>}
  247.    }
  248.  
  249.    composite {
  250.       leaves
  251.       scale <7 7 7>
  252.    }
  253.    
  254.    object {
  255.       intersection {
  256.          Cone_Y 
  257.          translate <0 1 0>
  258.          scale <1.6 55.33 1.6>
  259.       }
  260.       clipped_by {plane {<0 1 0> 83}}
  261.       texture {stem_texture}
  262.    }
  263.    object {
  264.       intersection {
  265.          Cone_Y 
  266.          translate <0 1 0>
  267.          scale <0.4 5 0.4>
  268.          rotate <10 -60 0>
  269.          translate <0 83 0>
  270.       }
  271.       texture {stem_texture}
  272.    }
  273.  
  274. }
  275.  
  276. //----------------------------------------------------------------------------
  277. // Background scene
  278. //----------------------------------------------------------------------------
  279.  
  280. composite {plant rotate <0 180 0> translate <-40 0 50>}
  281. composite {plant rotate <0 180 0> translate <40 0 50>}
  282.  
  283. // Sky
  284. object {
  285.    sphere {<0 0 0> 2000 inverse} 
  286.    texture {
  287.       gradient <0 1 0>
  288.       color_map {
  289.          [0.0  0.01 color Gray color Gray]
  290.          [0.01 0.35 color Gray color Gray15]
  291.          [0.35 0.55 color Gray15 color SkyBlue]
  292.          [0.55 1.0  color SkyBlue color SkyBlue]
  293.       }
  294.       ambient 1.0
  295.       diffuse 0.0
  296.  
  297.       scale <4000 4000 4000>
  298.       translate <0 -2000 0>
  299.    }
  300. }
  301.  
  302.  
  303. //----------------------------------------------------------------------------
  304. // Final scene
  305. //----------------------------------------------------------------------------
  306.  
  307. /* remove this line to render the final scene
  308.  
  309. composite {plant}
  310.  
  311. //  The background image_mapped plane is scaled and positioned so that the
  312. //    image fills the screen and is at right angles to the line of sight
  313. object {
  314.    plane {<0 0 1> 45 inverse}
  315.    texture {
  316.       image_map {<1 -1 0> tga "petalsbg.tga" once interpolate 4}
  317.       translate <-0.5 -0.5 0>
  318.       scale <113.33 84.90 1>
  319.  
  320.       ambient 1.0
  321.       diffuse 0.0
  322.    }
  323.    rotate <11.77 0 0>
  324.    translate <0 65 0>
  325. }
  326.  
  327. remove this line to render the final scene */
  328.  
  329.